package to;

public class WeightTO {
	private String materialName;
	private int totalWeight;
	
	public WeightTO() {}

	public WeightTO(String materialName, int totalWeight) {
		this.materialName = materialName;
		this.totalWeight = totalWeight;
	}

	public String getMaterialName() {
		return materialName;
	}

	public void setMaterialName(String materialName) {
		this.materialName = materialName;
	}

	public int getTotalWeight() {
		return totalWeight;
	}

	public void setTotalWeight(int totalWeight) {
		this.totalWeight = totalWeight;
	}

	@Override
	public String toString() {
		return "WeightTO [materialName=" + materialName + ", totalWeight="
				+ totalWeight + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((materialName == null) ? 0 : materialName.hashCode());
		result = prime * result + totalWeight;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		WeightTO other = (WeightTO) obj;
		if (materialName == null) {
			if (other.materialName != null)
				return false;
		} else if (!materialName.equals(other.materialName))
			return false;
		if (totalWeight != other.totalWeight)
			return false;
		return true;
	}
	
}
